<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<%--
  Created by IntelliJ IDEA.
  User: BF100233
  Date: 2016/9/22
  Time: 10:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>input</title>
</head>
<body>

<form:form action="emp" method="post" modelAttribute="employees">
    LastName:<form:input path="lastName"/>
    <br>
    Email:<form:input path="email"/>
    <%
        Map<String, String> genders = new HashMap<String, String>();
        genders.put("1","FaMale");
        genders.put("0", "Male");
        request.setAttribute("genders",genders);
    %>
    <br>
    Gender:<form:radiobuttons path="gender" items="${genders }"/>
    <br>

    Department:<form:select path="department.id" items="${departments}"
                            itemLabel="departmentName" itemValue="id" >
                </form:select>
    <br>
    <input type="submit" value="Submit" />
</form:form>

</body>
</html>
